﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CnGine.CodeGenerator.Models
{
    public class Column
    {
        private int _tableid = 0;
        private string _tablename = "";
        private bool _tableview = false;
        private int _columnid = 0;
        private string _name = "";
        private string _type = "";
        private int _length = 0;
        private int _xiaoshu = 0;
        private bool _isidentity = false;
        private bool _isprimarykey = false;
        private bool _isnull = false;
        private string _default = "";
        private string _desscription = "";


        /// <summary>
        /// 表或视图ID
        /// </summary>
        public int TableID
        {
            set { this._tableid = value; }
            get { return this._tableid; }
        }
        /// <summary>
        /// 表或视图名
        /// </summary>
        public string TableName
        {
            set { this._tablename = value; }
            get { return this._tablename; }
        }
        /// <summary>
        /// 是否是视图
        /// </summary>
        public bool TableView
        {
            set { this._tableview = value; }
            get { return this._tableview; }
        }
        /// <summary>
        /// 列ID号
        /// </summary>
        public int ColumnID
        {
            set { this._columnid = value; }
            get { return this._columnid; }
        }
        /// <summary>
        /// 列名
        /// </summary>
        public string Name
        {
            set { this._name = value; }
            get { return this._name; }
        }
        /// <summary>
        /// 列数据类型
        /// </summary>
        public string Type
        {
            set { this._type = value; }
            get { return this._type; }
        }
        /// <summary>
        /// 列数据长度
        /// </summary>
        public int Length
        {
            set { this._length = value; }
            get { return this._length; }
        }
        /// <summary>
        /// 列小数点后面的位数
        /// </summary>
        public int Xiaoshu
        {
            set { this._xiaoshu = value; }
            get { return this._xiaoshu; }
        }
        /// <summary>
        /// 是否是自动增长列
        /// </summary>
        public bool IsIdentity
        {
            set { this._isidentity = value; }
            get { return this._isidentity; }
        }
        /// <summary>
        /// 是否是主键
        /// </summary>
        public bool IsPrimaryKey
        {
            set { this._isprimarykey = value; }
            get { return this._isprimarykey; }
        }
        /// <summary>
        /// 是否可以为空
        /// </summary>
        public bool IsNull
        {
            set { this._isnull = value; }
            get { return this._isnull; }
        }
        /// <summary>
        /// 列默认值
        /// </summary>
        public string Default
        {
            set { this._default = value; }
            get { return this._default; }
        }
        /// <summary>
        /// 列描述信息
        /// </summary>
        public string Description
        {
            set { this._desscription = value; }
            get { return this._desscription; }
        }
    }
}
